<%@ page language="java" contentType="text/html; charset=UTF-8"
		 pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="tag" tagdir="/WEB-INF/tags" %>
<c:set var="ctx" value="${pageContext.request.contextPath}" />

<!DOCTYPE html>
<html>
<tag:head title="评论管理" ctx="${ctx}">
	<link href="${ctx}/assets/css/admin/admin_role_list/style.css" rel="stylesheet">	<!-- 该页面特定的样式 -->
</tag:head>

<tag:body>
	<!-- 左 上 导航 -->
	<tag:nav ctx="${ctx}"></tag:nav>

	<!-- page content -->
	<div class="right_col" role="main">
		<div class="">
			<div class="clearfix"></div>

			<div class="row">
				<div class="col-md-12 col-sm-12 col-xs-12">
					<div class="x_panel">
						<div class="x_title">
							<h2>
								评论列表
							</h2>
							<ul class="nav navbar-right panel_toolbox">
								<li>
									<button type="button" class="btn btn-danger" data-toggle="modal"
											data-target=".bs-example-modal-deg"><i class="fa fa-trash-o"></i>删除选定
									</button>
								</li>
							</ul>
							<div class="clearfix"></div>
						</div>
						<div class="x_content">
							<table id="datatable-checkbox" class="table table-striped table-bordered bulk_action">
								<thead>
								<tr>
									<th width="5%"><input type="checkbox" id="check-all"></th>
									<th width="7%" style="display: none;">ID</th>
									<th width="7%">员工号</th>
									<th width="10%">员工名称</th>
									<th width="7%">图书号</th>
									<th width="10%">图书名称</th>
									<th width="20%">描述</th>
									<th width="7%">分数</th>
									<th width="7%">举报数</th>
									<th width="7%">赞数</th>
									<th width="10%">日期</th>
									<th width="20%">操作</th>
								</tr>
								</thead>

								<tbody>
								<c:forEach var="evaluate" items="${requestScope.evaluates}">
									<tr>
										<td width="5%"><input type="checkbox"  name="table_records"/></td>
										<td width="7%" style="display: none;">${evaluate.evaluateId}</td>
										<td width="10%">${evaluate.staff.staffId}</td>
										<td width="10%">${evaluate.staff.name}</td>
										<td width="10%">${evaluate.book.bookId}</td>
										<td width="10%">${evaluate.book.name}</td>
										<td width="10%">
											<a href='#' class='btn btn-primary btn-xs' data-toggle='modal' data-target='.bs-example-modal-ce' onclick='checkEvaluateInfo(this)'>
												<i class='fa fa-pencil'></i>
												查看描述
											</a>
										</td>
										<td width="10%">${evaluate.grade}</td>
										<td width="10%">${evaluate.forbidden}</td>
										<td>${evaluate.praise}</td>
										<td>${evaluate.date}</td>
										<td width="25%">
											<a href='#' class='btn btn-danger btn-xs' data-toggle='modal' data-target='.bs-example-modal-de' onclick='deleteEvaluateInfo(this)'>
												<i class='fa fa-trash-o'></i>
												删除
											</a>
										</td>
									</tr>
								</c:forEach>
								</tbody>
							</table>
							<div class="dataTables_paginate paging_simple_numbers" id="datatable-checkbox_paginate">
								<ul class="pagination">
									<li class="paginate_button previous disabled" id="datatable-checkbox_previous">
										<a href="javascript:void(0)" aria-controls="datatable-checkbox" data-dt-idx="0" tabindex="0">上一页</a>
									</li>
									<li class="paginate_button next disabled" id="datatable-checkbox_next">
										<a href="javascript:void(0)" aria-controls="datatable-checkbox" data-dt-idx="2" tabindex="0">下一页</a>
									</li>
								</ul>
							</div>
						</div>
					</div>
				</div>

			</div>


		</div>
	</div>
	<!-- /page content -->

	<!-- footer content -->
	<tag:footer></tag:footer>
</tag:body>
<!-- javascript -->
<tag:javascript ctx="${ctx}">
	<!-- this page -->
	<script src="${ctx}/assets/js/admin/admin_evaluate_list/admin_evaluate_list.js"></script>
	<script>
		<c:if test="${requestScope.error != null}">
			createPNotify("提示信息","error","${requestScope.error}");
		</c:if>
		initTable();

		<c:choose>
		<c:when test="${requestScope.page.pageSize == 10 || requestScope.page.pageSize == 50 || requestScope.page.pageSize == 25 || requestScope.page.pageSize == 100}">
			$("#pageSize").val(${requestScope.page.pageSize});
		</c:when>
		<c:otherwise>
			$("#pageSize").val("all");
		</c:otherwise>
		</c:choose>

		createPaging($('#datatable-checkbox_paginate'),${requestScope.page.currentPageNum},${requestScope.page.totalPageNum},'evaluateList(this)',10);
		adjustPagination($("#datatable-checkbox_paginate").children("ul"),${requestScope.page.currentPageNum},${requestScope.page.totalPageNum});
	</script>
</tag:javascript>
</html>

<!-- start:查看评论内容 -->
<div class="modal fade bs-example-modal-ce" tabindex="-1" role="dialog" aria-hidden="true">
	<div class="modal-dialog modal-lg">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span>
				</button>
				<h4 class="modal-title" id="myModalLabel">查看评论</h4>
			</div>
			<div class="modal-body">
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
			</div>

		</div>
	</div>
</div>
<!-- end:查看评论内容 -->


<!-- start:删除评论 -->
<div class="modal fade bs-example-modal-de" tabindex="-1" role="dialog" aria-hidden="true">
	<div class="modal-dialog modal-sm">
		<div class="modal-content">

			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
						aria-hidden="true">×</span>
				</button>
				<h4 class="modal-title">删除评论</h4>
			</div>
			<div class="modal-body">
				<h4>确定删除选定的？</h4>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
				<button type="button" class="btn btn-primary">确定</button>
			</div>
		</div>
	</div>
</div>
<!-- end:删除员工 -->

<!-- start:删除多个评论 -->
<div class="modal fade bs-example-modal-deg" tabindex="-1" role="dialog" aria-hidden="true">
	<div class="modal-dialog modal-sm">
		<div class="modal-content">

			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
						aria-hidden="true">×</span>
				</button>
				<h4 class="modal-title" id="myModalLabel2">删除评论</h4>
			</div>
			<div class="modal-body">
				<h4>确定删除选定的？</h4>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
				<button type="button" class="btn btn-primary">确定</button>
			</div>

		</div>
	</div>
</div>
<!-- end:删除多个评论 -->
